#pragma once

#include <windows.h>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
using namespace std;

/////////////////////////////////////////////////////////////////////////////

// Preprocessor Definitions
// 1. CZ_SHOW_LOG


/////////////////////////////////////////////////////////////////////////////

typedef unsigned __int64 u64;
typedef __int64 i64;
typedef unsigned int u32;
typedef int i32;
typedef unsigned short u16;
typedef short i16;
typedef unsigned char u8, byte;
typedef char i8;

typedef unsigned __int64 const u64c;
typedef __int64 const i64c;
typedef unsigned int const u32c;
typedef int const i32cp;
typedef unsigned short const u16c;
typedef short const i16c;
typedef unsigned char const u8c;
typedef char const i8c, charc;

typedef string const stringc;
typedef wstring const wstringc;
typedef void const voidc;

typedef wchar_t wchar;
typedef wchar const wcharc;

typedef unsigned long ul;

/////////////////////////////////////////////////////////////////////////////

#ifdef UNICODE
#define tcout wcout
typedef wifstream tifstream;
typedef wofstream tofstream;
typedef wstring tstring;
typedef wstring const tstringc;
typedef wchar tchar;
typedef wchar const tcharc;
#else
#define tcout cout
typedef ifstream tifstream;
typedef ofstream tofstream;
typedef string tstring;
typedef string const tstringc;
typedef char tchar;
typedef char const tcharc;
#endif


/////////////////////////////////////////////////////////////////////////////

#ifndef IN
#define IN
#endif

#ifndef OUT
#define OUT
#endif

#ifndef INOUT
#define INOUT
#endif

/////////////////////////////////////////////////////////////////////////////

#define CZ_COMBINEA(a, b)				a ## A ## b
#define CZ_COMBINEW(a, b)				a ## W ## b

#ifdef UNICODE
#define CZ_COMBINET(a, b) CZ_COMBINEW(a, b)
#else
#define CZ_COMBINET(a, b) CZ_COMBINEA(a, b)
#endif

/////////////////////////////////////////////////////////////////////////////

#define CZ_WIDEN2(str)				L ## str
#define CZ_WIDEN(str)				CZ_WIDEN2(str)
#define __WFILE__					CZ_WIDEN(__FILE__)
#define __AFILE__					__FILE__

#define __TFILE__					CZ_COMBINET(__, FILE__)


////////////////////////////////////////////////////////////////////////////

#define CZ_MAX_U32					0xffffffff
#define CZ_MAX_I32					0x7fffffff
#define CZ_MAX_U16					0xffff
#define CZ_MAX_I16					0x7fff
#define CZ_MAX_U8					0xff
#define CZ_MAX_I8					0x7f


////////////////////////////////////////////////////////////////////////////

#define CZ_MAX_PATHW				MAX_PATH
#define CZ_MAX_PATHA				MAX_PATH * 2

#ifdef UNICODE
#define CZ_MAX_PATHT CZ_MAX_PATHW
#else
#define CZ_MAX_PATHT CZ_MAX_PATHA
#endif